package com.xxhong.xxtv.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.widget.LinearLayout;

import com.xxhong.xxtv.R;

/**
 * Created by houn.xu
 */

public class SplashActivity extends Activity {
    LinearLayout llSplash;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splash_view);
        llSplash = (LinearLayout) findViewById(R.id.ll_splash);
        AlphaAnimation aa = new AlphaAnimation(1,0);
        aa.setDuration(1000);
        aa.setAnimationListener(new Animation.AnimationListener() {
            @Override
            public void onAnimationStart(Animation animation) {

            }

            @Override
            public void onAnimationEnd(Animation animation) {
                SplashActivity.this.startActivity(new Intent(SplashActivity.this,MainActivity.class));
                finish();
            }

            @Override
            public void onAnimationRepeat(Animation animation) {

            }
        });
        llSplash.setAnimation(aa);
        aa.start();
    }
}
